# from ultralytics import YOLO
# import cv2
# from PIL import Image

# # Create a new YOLO model from scratch
# # model = YOLO("yolo11n.yaml")

# # Load a pretrained YOLO model (recommended for training)
# model = YOLO("yolo11n.pt")

# # # Train the model using the 'coco8.yaml' dataset for 3 epochs
# # results = model.train(data="coco8.yaml", epochs=3)

# # # Evaluate the model's performance on the validation set
# # results = model.val()

# # Perform object detection on an image using the model
# # results = model("https://ultralytics.com/images/bus.jpg")

# # Export the model to ONNX format
# # success = model.export(format="onnx")

# # from PIL
# im1 = Image.open("bus.jpg")
# results = model.predict(source=im1, save=True)  # save plotted images
# print(results)


from config import model, imgsz

# Train the model
results = model.train(data="D:/code/adblocker/img", epochs=5, imgsz=imgsz)
